package com.yinhe.music.yhmusic.db.bean;

import com.j256.ormlite.field.DatabaseField;
import com.yinhe.music.yhmusic.constants.IConstants;
import com.yinhe.music.yhmusic.model.Music;


/**
 * Created by hasee on 2017/3/30.
 */

public class SongDBEntity extends RecentMusicDBEntity {

    @DatabaseField(columnName = SongStoreColumns.LANG)
    private String lang;
    @DatabaseField(columnName = SongStoreColumns.LEVEL)
    private int level;
    @DatabaseField(columnName = SongStoreColumns.OPT)
    private int opt;

    //表示是否是本地歌曲
    @DatabaseField(columnName = SongStoreColumns.IS_SYN)
    private boolean isSyn = false;

    @DatabaseField(columnName = SongStoreColumns.FILE_TYPE)
    private Music.Type file_type;

    @DatabaseField(columnName = SongStoreColumns.DURATION)
    private String duration;

    @DatabaseField(columnName = SongStoreColumns.SIZE)
    private String size;

    @DatabaseField(columnName = SongStoreColumns.PRICE)
    private float price;

    @DatabaseField(columnName = SongStoreColumns.SYS_MUSIC_LANG)
    private int sysmusiclang;

    public SongDBEntity() {

    }

    public SongDBEntity(Music music) {
        super();
        this.albumid = music.getAlbumId();
        this.albumname = music.getAlbumName();
        this.image = music.getImage();
        this.lang = music.getLang();
        this.level = music.getLevel();
        this.lyrics = music.getLyric();
        this.price = music.getPrice();
        this.singerid = music.getSingerId();
        this.singername = music.getSingerName();
        this.songid = music.getSongId();
        this.songname = music.getSongName();
        this.file_type = music.getFileType();
        this.uri = music.getFilePath();
        this.url = music.getUrl();
        this.qtype = IConstants.Common;
        this.quality = music.getQualityLevel();
        this.lyricsCode = music.getLyricCode();
        this.sysmusiclang = music.getNationalType();
    }


    public interface SongStoreColumns extends RecentMusicDBEntity.RecentSongColums {
        String OPT = "opt";
        String LEVEL = "level";
        String LANG = "lang";
        String IS_SYN = "is_syn";  // 是否同步
        String FILE_TYPE = "file_type";
        String DURATION = "duration";
        String SIZE = "size";
        String PRICE = "price";
        String SYS_MUSIC_LANG = "sysmusiclang";
    }

    public int getSysmusiclang() {
        return sysmusiclang;
    }

    public void setSysmusiclang(int sysmusiclang) {
        this.sysmusiclang = sysmusiclang;
    }

    public boolean isSyn() {
        return isSyn;
    }

    public void setSyn(boolean syn) {
        isSyn = syn;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public Music.Type getFile_type() {
        return file_type;
    }

    public void setFile_type(Music.Type file_type) {
        this.file_type = file_type;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    @Override
    public long getAlbumid() {
        return albumid;
    }

    @Override
    public void setAlbumid(long albumid) {
        this.albumid = albumid;
    }

    @Override
    public int getAlbumidx() {
        return albumidx;
    }

    @Override
    public void setAlbumidx(int albumidx) {
        this.albumidx = albumidx;
    }

    @Override
    public String getAlbumname() {
        return albumname;
    }

    @Override
    public void setAlbumname(String albumname) {
        this.albumname = albumname;
    }

    @Override
    public String getImage() {
        return image;
    }

    @Override
    public void setImage(String image) {
        this.image = image;
    }

    @Override
    public int getIslike() {
        return islike;
    }

    @Override
    public void setIslike(int islike) {
        this.islike = islike;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }


    @Override
    public String getLyrics() {
        return lyrics;
    }

    @Override
    public void setLyrics(String lyrics) {
        this.lyrics = lyrics;
    }

    public int getOpt() {
        return opt;
    }

    public void setOpt(int opt) {
        this.opt = opt;
    }

    @Override
    public int getSingerid() {
        return singerid;
    }

    @Override
    public void setSingerid(int singerid) {
        this.singerid = singerid;
    }

    @Override
    public String getSingername() {
        return singername;
    }

    @Override
    public void setSingername(String singername) {
        this.singername = singername;
    }

    @Override
    public long getSongid() {
        return songid;
    }

    @Override
    public void setSongid(long songid) {
        this.songid = songid;
    }

    @Override
    public String getSongname() {
        return songname;
    }

    @Override
    public void setSongname(String songname) {
        this.songname = songname;
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public void setType(String type) {
        this.type = type;
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }
}
